<template>
  <div id="app">
    <h1>Vue3 组件通信示例</h1>
    
    <ParentChildExample />
    <ProvideInjectExample />
    <SiblingCommunicationExample />
  </div>
</template>

<script setup>
import ParentChildExample from './components/parent-child/ParentComponent.vue'
import ProvideInjectExample from './components/provide-inject/RootComponent.vue'
import SiblingCommunicationExample from './components/siblings/ParentContainer.vue'
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #42b983;
}

.component-container {
  border: 1px solid #ddd;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 6px;
}
</style>